Skip to content

Adds native SeedVR2 support - #1463

Open
jtreminio wants to merge 7 commits into
mcmonkeyprojects:masterfrom
jtreminio:seedvr
Open

Adds native SeedVR2 support#1463
jtreminio wants to merge 7 commits into
mcmonkeyprojects:masterfrom
jtreminio:seedvr

Conversation

@jtreminio

Copy link
Copy Markdown
Contributor

To be rebased once #1462 is merged

Comment thread docs/Features/Upscaling.md Outdated

(TODO)

# Upscale Stages

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get rid of this


/// <summary>Set of all feature-ids supported by ComfyUI backends.</summary>
public static HashSet<string> FeaturesSupported = ["comfyui", "refiners", "controlnet", "endstepsearly", "seamless", "video", "variation_seed", "freeu", "yolov8"];
public static HashSet<string> FeaturesSupported = ["comfyui", "refiners", "controlnet", "endstepsearly", "seamless", "video", "variation_seed", "freeu", "yolov8", "seedvr2"];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be here

GetValues: (session) => [.. UpscalerModels, .. PidUpscaleModels(session)], DependNonDefault: T2IParamTypes.RefinerUpscale.Type.ID
GetValues: (session) => [.. UpscalerModels, .. PidUpscaleModels(session), .. SeedVR2UpscaleModels(session)], DependNonDefault: T2IParamTypes.RefinerUpscale.Type.ID
));
FinalUpscaleMethod = T2IParamTypes.Register<string>(new("Final Upscale Method", "How to upscale the image, if upscaling is used.\nNo sampler runs after this, so latent upscalers are not available here.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't belong at all

"256", Min: 64, Max: 2048, Step: 32, Toggleable: true, IsAdvanced: true, FeatureFlag: "comfyui", ViewType: ParamViewType.POT_SLIDER, Group: T2IParamTypes.GroupAdvancedSampling, OrderPriority: 20
));
SeedVR2ColorCorrectionBehavior = T2IParamTypes.Register<string>(new("SeedVR2 Color Correction Behavior", "How to match the colors of a SeedVR2 upscale back to the image it was given.\n'None' = Do not attempt color correction, only align the geometry.\n'CIELAB' = Transfer the color in CIELAB space, preserving detail.\n'Wavelet' = Transfer the low-frequency color, keeping the upscaled high-frequency detail.\n'AdaIN' = Match the per-channel mean and standard deviation.",
"none", FeatureFlag: "seedvr2", Group: T2IParamTypes.GroupAdvancedSampling, IsAdvanced: true, OrderPriority: 21, GetValues: (_) => ["none///None", "lab///CIELAB", "wavelet///Wavelet", "adain///AdaIN"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs an ignoreif

"false", IgnoreIf: "false", FeatureFlag: "seedvr2", Group: T2IParamTypes.GroupAdvancedSampling, IsAdvanced: true, OrderPriority: 22
));
SeedVR2TemporalVideoOverlap = T2IParamTypes.Register<int>(new("SeedVR2 Temporal Video Overlap", "Overrides 'VAE Temporal Tile Overlap' for 'SeedVR2 Split Latent' chunks.\nHigher overlap hides the chunk seams better but takes longer.",
"0", Min: 0, Max: 4096, Step: 1, Toggleable: true, VisibleNormally: false, IsAdvanced: true, FeatureFlag: "seedvr2", Group: T2IParamTypes.GroupAdvancedSampling, OrderPriority: 23

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this VisibleNormally: false?

["vae_conditioning"] = latent
});
string sampled = CreateKSampler(CurrentModel.Path, [cond, 0], [cond, 1], latent, 1, 1, 0, 10000, seed, false, true,
explicitSampler: "euler", explicitScheduler: "simple");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange format

{
return ScaleRawMedia(raw, width, height, method.After("pixel-"));
}
throw new SwarmUserErrorException($"Upscale method '{method}' needs a sampler after it, so it can't be used as a Final Upscale Method. Use it in the Refine/Upscale group instead.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odd message, this isn't correct for any upscale method

// TODO: Better same-VAE check
bool doPixelUpscale = doUpscale && (upscaleMethod.StartsWith("pixel-") || upscaleMethod.StartsWith("model-"));
bool doPidUpscale = doUpscale && upscaleMethod.StartsWith("pidmodel-");
bool doSeedVR2Upscale = doUpscale && upscaleMethod.StartsWith("seedvr2model-");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seedvr is not an upscale model

Comment thread src/Text2Image/T2IParamTypes.cs Outdated
));
// ================================================ Final Stage ================================================
GroupFinalStage = new("Final Stage", Toggles: true, Open: false, OrderPriority: -2.5, Description: "An upscale applied after the base and refiner stages are done.\nUnlike the Refine/Upscale group, nothing samples over the result after, only whatever the upscaler does itself.");
FinalUpscale = Register<double>(new("Final Upscale", "How much to upscale by in the final stage.\nThis stacks on top of Refiner Upscale, so 1.5 refiner upscale and 2 final upscale is 3x total.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

@jtreminio
jtreminio marked this pull request as ready for review August 1, 2026 02:00
@jtreminio

Copy link
Copy Markdown
Contributor Author

I did not add section, so base loras will apply. Let me know if that should go in this PR or a separate one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants